<template>
  <div id="app">
    <!-- <keep-alive include="category,home"> -->
    <router-view />
    <!-- </keep-alive> -->
    <van-tabbar
      route
      v-show="!(path === '/detail') &&
       !(path === '/login') && 
       !(path === '/register') && 
       !(path === '/pim/pimrecord') && 
       !(path === '/pim/pimrecord2') && 
       !(path === '/pim/pimrecord3') && 
       !(path === '/pim/pimrecord4')"
    >
      <van-tabbar-item to="/" icon="home-o">首页</van-tabbar-item>
      <!-- <van-tabbar-item replace to="/search" icon="search">搜索</van-tabbar-item> -->
      <van-tabbar-item replace to="/category" icon="apps-o">分类</van-tabbar-item>
      <van-tabbar-item replace to="/cart" icon="shopping-cart-o" >购物车</van-tabbar-item>
      <!-- <van-tabbar-item replace to="/mine" icon="user-o">我的</van-tabbar-item> -->
    </van-tabbar>

    <!-- <MainTabBar
      v-show="!(path === '/detail') &&
       !(path === '/login') && 
       !(path === '/pim/pimrecord') && 
       !(path === '/pim/pimrecord2') && 
       !(path === '/pim/pimrecord3') && 
       !(path === '/pim/pimrecord4')"
    ></MainTabBar>-->
  </div>
</template>
<script>
// import MainTabBar from "@/components/common/tabbar/MainTabBar";
export default {
  name: "app",
  data() {
    return {
      path: ""
    };
  },
  watch: {
    $route(to, from) {
      this.path = to.path;
      console.log(this.path, to.path);
    }
  },
  mounted() {
    this.path = this.$route.path;
  },
  components: {
    // MainTabBar
  }
};
</script>
<style>
#app {
  font-size: 16px;
  height: 100vh;
}
@font-face {
  font-family: "icomoon";
  src: url("fonts/icomoon.eot?lle8gv");
  src: url("fonts/icomoon.eot?lle8gv#iefix") format("embedded-opentype"),
    url("fonts/icomoon.ttf?lle8gv") format("truetype"),
    url("fonts/icomoon.woff?lle8gv") format("woff"),
    url("fonts/icomoon.svg?lle8gv#icomoon") format("svg");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

.van-tabbar {
  position: fixed;;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
}
</style>
